<div class="table">
	<h2>Top <?=$rows_shown?> Players</h2>
	<div class="content">
			<ul class="heading"> 
				<li class="tp_rank">Rank</li>
				<li class="tp_name">Name</li>
				<li class="tp_tier">Tier</li>
				<li class="tp_rating">Rating</li>
			</ul>
			<?php $rank = 1 ;?>
    		<?php foreach ($player as $item): ?>
				<?php if (($this->auth->logged_in()) && ($item['user_id']==$this->auth->id()))
				{
					$highlight = 'highlight';
				}
				else
				{
					$highlight = '';
				}
				?>
				<ul class="row" id="<?=$highlight?>">
					<li class="tp_rank">
						<?php if ($rank == 1): ?>
							<img src="<?=base_url()?>assets/images/gold.png" alt="Rank 1" />
						<?php elseif ($rank == 2): ?>
							<img src="<?=base_url()?>assets/images/silver.png" alt="Rank 2" />
						<?php elseif($rank == 3): ?>
							<img src="<?=base_url()?>assets/images/bronze.png" alt="Rank 3" />
						<?php else: ?>
							#<?= $rank ?>
						<?php endif; ?>
					</li>
					<li class="tp_name">
						<a href="<?= site_url(array('stats', 'player', $item['user_id'])) ?>"><?= $item['name'] ?></a>
					</li>
					<li class="tp_tier"><?= $item['tier'] ?></li>
					<li class="tp_rating">
						<?php if ($item['rating'] != $item['old_rating']): ?>
                            <?php if($item['rating'] > $item['old_rating']): ?>
                                    <?= round($item['rating'],2)?> <img src="<?=base_url()?>assets/images/rating_up.png" /> <?= round($item['rating']-$item['old_rating'],2)?>
                            <?php else: ?>
                                    <?= round($item['rating'],2)?> <img src="<?=base_url()?>assets/images/rating_down.png" /> <?= round($item['old_rating']-$item['rating'],2)?>
                            <?php endif; ?>
                        <?php else: ?>
                            <?= round($item['rating'], 2)?>
                        <?php endif; ?>
					</li>
				</ul>
				<?php $rank++; ?>
			<?php endforeach; ?>
	</div>
	<span class="fill"></span>
</div>